/**
 * Created by Francis.LW on 2017/10/20.
 *
 * 保险服务提供商服务接口
 */
import {postRequest, getRequest} from '@/common/request'
import {urls} from './url'

const insuranceServiceSupplierApi = urls.insuranceServiceSupplier

function listAll(success, complete) {
  postRequest(insuranceServiceSupplierApi.listAll, {}, {}, success, complete)
}

function listOperationRescueCompany(param, page, pageSize, success, complete) {
  postRequest(insuranceServiceSupplierApi.listOperationRescueCompany + '?currentpage=' + page + '&pagesize=' + pageSize, {}, param, success, complete)
}

function listRescueCompany(param, page, pageSize, success, complete) {
  postRequest(insuranceServiceSupplierApi.listRescueCompany + '?currentpage=' + page + '&pagesize=' + pageSize, {}, param, success, complete)
}


function updateBaseRescueCompany(id, param, success, complete) {
  postRequest(insuranceServiceSupplierApi.updateBaseRescueCompany + id, {}, param, success, complete)
}

function getRescueCompanyById(id, success, complete) {
  getRequest(insuranceServiceSupplierApi.getRescueCompanyById + id, {}, success, complete)
}

function removeRescueCompany(ids, success, complete) {
  postRequest(insuranceServiceSupplierApi.removeRescueCompany, {}, ids, success, complete)
}

function deleteSingleRescueCompany(id, success, complete) {
  let ids = []
  ids.push(id)
  removeRescueCompany(ids, success, complete)
}

export default {
  listAll,
  listOperationRescueCompany,
  listRescueCompany,
  updateBaseRescueCompany,
  getRescueCompanyById,
  removeRescueCompany,
  deleteSingleRescueCompany
}
